@model zhangmenren.Models.ViewModle.TuiJianModel


@if (Model != null)

{

    
    <div class="bg-white">
        <header class="mui-bar mui-bar-nav head-bar-nav" style="background-color: #454a4b;">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left" href='@Url.Action("Index")'></a>
            <h1 class="mui-title"></h1>
            <a class="mui-icon mui-icon-more mui-pull-right" onclick="jsBridge.share()"></a>
        </header>

        <style>


            #J_prismPlayer_component_9C5DD406-2C7A-4EDC-96C3-59CD24140218 {
                position: absolute;
                left: 40%;
                bottom: 40%;
                display: block;
            }
        </style>
        <!--DOM -->
        <div class="mui-content bg-gray">
            @*<img src="images/xk-video-banner.jpg" alt="" width="100%" />*@
            <div class="prism-player" id="J_prismPlayer"></div>
            <br />
            <div class="xkdetail-flxed-box bg-white">
                <div class="xkdetail-flxed-item mui-text-center j-dianzhan">
                    <img src="/images/xkdetail-flxed-item1.png" width="26px" />
                    <p>点赞（@Model.DianZhanNum）</p>
                </div>
                <div class="xkdetail-flxed-item mui-text-center j-guanzhu">
                    <img src="/images/xkdetail-flxed-item2.png" width="25px" />
                    <p>关注（@Model.GuanZhuNum）</p>
                </div>
            </div>
            <br />
            <button class="mui-btn mui-btn-block i-kc-btn link-href ds-btn">
                <span style="background: none;padding: 0;">打赏犒劳下</span>
            </button>
            <br />
            <!---->
            <div class="chat-content bg-white" style="margin: 0;padding:0 10px;">


                <div class="list-header">
                    <a class="header-icon" style="background-image: url(/images/header-icon-xkdetailicon.png);">
                        评论
                    </a>
                </div>
                <div style="width: 100%;margin: 10px auto;border-radius: 5px;background-color: rgb(255, 255, 255);box-shadow: 0px 0px 18px 0px rgba(0, 0, 0, 0.08);">
                    @if (ViewBag.Comment != null && (ViewBag.Comment as List<zhangmenren.Models.CommentEntity>).Count > 0)
                    {
                        foreach (var item in ViewBag.Comment as List<zhangmenren.Models.CommentEntity>)
                        {
                            <dl class="all-pl-group">
                                <dt class="mui-clearfix">
                                    <div class="head">
                                        <img src="@item.HeadImg">
                                    </div>
                                    <div class="mui-pull-left">
                                        <p>@item.UserName</p>
                                        <p style="color: #b2b2b2; font-size: 12px;">@string.Format("{0:MM-dd HH:dd}", item.AddDT)</p>
                                        <p>@item.Content</p>
                                    </div>
                                </dt>

                            </dl>
                        }
                    }



                    <dl class="all-pl-group">
                        <dt class="mui-clearfix">
                            <div class="head">
                                <img src="images/personalData-headImg.png" alt="">
                            </div>
                            <div class="mui-pull-left">
                                <p>一克拉梦想ykt1</p>
                                <p style="color: #b2b2b2;font-size: 12px;">10小时前</p>
                                <p>请问这个软件我应该从哪里学起呢？</p>
                            </div>
                        </dt>

                    </dl>

                </div>
            </div>
            <!---->
        </div>

        <div class="chat-flexed-box">
            <div class="chat-input-box chat-input-theme1">
                <input type="text" placeholder="说点什么" class="j-content" />
            </div>
            <span class="emoji-btn j-comment"></span>
        </div>
    </div>

    @section Scripts{

        <script>
player("J_prismPlayer","@Model.Url","@Model.CoverImg",'true');
        </script>


        <script>
    $(".j-dianzhan").click(function() {
        $.ajax({
            type: "post",
            url: "/TuiJian/AddOne",
            data: {
                workId: @Model.Id,
                type: 1
            },
            success: function(result) {
                layerm.open({
                    content: result.msg,
                    skin: 'msg',
                    time: 2 //2秒后自动关闭
                });
                if (result.state = 'ok') {
                    //这里给点赞按钮加class
                    alert("这里给点赞按钮加class 并把点赞加1")
                }

            }
        })
    });

        $(".j-guanzhu").click(function() {
            $.ajax({
                type: "post",
                url: "/TuiJian/AddOne",
                data: {
                    workId: @Model.Id,
                    type: 2
                },
                success: function(result) {
                    layerm.open({
                        content: result.msg,
                        skin: 'msg',
                        time: 2 //2秒后自动关闭
                    });
                    if (result.state = 'ok') {
                        //
                        alert("这里给关注按钮加class并把关注添加1")
                    }

                }
            })
        });


    $.ajax({
        type:"post",
        url:"/TuiJian/GetOne",
        data:{workId:@Model.Id},
        success:function (result) {
            if (result.state=="1") {
                //这里给点赞添加样式
                alert("这里给点赞添加样式")
            }

            if (result.state=="2") {
                //这里给关注添加成功样式
                alert("这里给关注添加成功样式")
            }
            if (result.state=="3") {
                //这里给关注和点赞添加成功样式
                alert("这里给关注和点赞添加成功样式")
            }
        }
    })
    $(".j-comment").click(function () {
        if ($(".j-content").val().length<1) {
            layerm.open({
                content: "请输入内容",
                btn:"确定"
            });
            return false;
        }

        $.ajax({
            type:"post",
            url:'@Url.Action("AddComment")',
            data:{workId:@Model.Id,content:$(".j-content").val()},
            success:function (result) {
                $(".j-content").val('')
                if (result.state=="ok") {
                    layerm.open({
                        content: result.msg,
                        skin: 'msg',
                        time: 2 //2秒后自动关闭
                    });
                }
            }
        })
    })

        </script>

    }


}
else
{
    <span>暂无数据</span>
}

